<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>


  <script>

    // 💥普通函数中this， 谁调用指向谁
    // 💥箭头函数和中this： 
    // 1. 箭头函数没有this
    // 2. this会自动绑定到箭头函数执行时，作用域内的this
    const zs = {
      name: "zs",
      age: 18,

      sayHello() {
        console.log('this  ----->  ', this);
      },

      sayHi: () => {
        console.log('this  ----->  ', this);
      }
    };

    zs.sayHello() // this => zs
    zs.sayHi() // this => window


  </script>

</body>

</html>